home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / fractal / kaos.lha / symbollib / triangle.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-11-18  |  717 b   |  24 lines

  1. /*
  2. ### draw a triangle ###
  3. */
  4.  
  5. #include <suntool/sunview.h>
  6.  
  7. triangle(pw,xp,yp,s,color,p_type)
  8. Pixwin *pw;
  9. int xp,yp,s,color,p_type;
  10. {
  11.  
  12.         if(p_type==0){
  13.                 pw_vector(pw,xp-s+1,yp+s,xp+s-1,yp+s,PIX_SRC | PIX_COLOR(color),1);
  14.                 pw_vector(pw,xp+s,yp+s,xp,yp-s,PIX_SRC | PIX_COLOR(color),1);
  15.                 pw_vector(pw,xp,yp-s,xp-s,yp+s,PIX_SRC | PIX_COLOR(color),1);
  16.         }
  17.         else {
  18.                 pw_vector(pw,xp-s+1,yp+s,xp+s-1,yp+s, (PIX_SRC ^ PIX_DST) | PIX_COLOR(color),1);
  19.                 pw_vector(pw,xp+s,yp+s,xp,yp-s, (PIX_SRC  ^ PIX_DST) | PIX_COLOR(color),1);
  20.                 pw_vector(pw,xp,yp-s,xp-s,yp+s, (PIX_SRC ^ PIX_DST) | PIX_COLOR(color),1);
  21.         }
  22. }
  23.  
  24.